<template>
<div id="queryTemplate">
	<el-row>
		<el-col :span="24">
			<el-form :model="queryform" :status-icon="true" :show-message="false" :inline="true" ref="queryform" label-width="100px" class="demo-ruleForm">
				
				<el-row>
					<el-col :span="11" >
						<el-form-item label="api类型" prop="apiType">	
							<el-select v-model="queryform.apiType" placeholder="请选择">
								<el-option label="公共api" value="0"></el-option>
								<el-option label="认证api" value="1"></el-option>
								<el-option label="授权api" value="2"></el-option>
							</el-select>
						</el-form-item>
					</el-col>

					<el-col :span="11">
						<el-form-item label="链接" prop="href">
							<el-input v-model="queryform.href" ></el-input>
						</el-form-item>
					</el-col>
					
				</el-row>

				<el-row>
					<el-col :span="11">
						<el-form-item label="方法" prop="method">
							<el-select v-model="queryform.method" placeholder="请选择" >
								<el-option label="POST" value="POST"></el-option>
								<el-option label="GET" value="GET"></el-option>
							</el-select>
						</el-form-item>
					</el-col>
				</el-row>
			</el-form>
		</el-col>
	</el-row>
</div>
	
</template>

<script>
// import treeSelect from "components/tree/treeSelect";
// import gridSelect from "components/grid/gridSelect";
// import dropSelect from "components/select/dropSelect";
export default {
  name:'apiQueryTemplate',
  components: {
	  
  },
  data() {
    return {
      queryform: {apiType:undefined,href:undefined,method:undefined}
    };
  },
  props: {
    submitSearch:{type:String,}
  },
  watch: {
    submitSearch: function(val) {
      if (val == "true") {
        this.$emit("query-data",this.queryform);
      }else if(val=="false"){
        this.$refs["queryform"].resetFields();
        setTimeout(()=>{
            this.$emit("refresh-quey-data",this.queryform);
            },200)
      };
      setTimeout(()=>{
        this.$emit("update:submitSearch","0");
      },200)
    },
  }
};
</script>

<style rel="stylesheet" lang="scss" scoped>

</style>